<%@ page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<% response.setHeader("Cache.Control", "no-cache");
        response.setHeader("Pragma", "no-cache");
        response.setDateHeader("Expires", 0);%>

<jsp:useBean id="action" scope="request"
             class="swd.deploy.frame_maintain.Action" />
<jsp:useBean id="view" scope="request"
             class="swd.deploy.frame_maintain.View" />
<jsp:setProperty name="view" property="*" />
<%if (action.action(pageContext).equals("login")) {
            return;
        }%>
<jsp:useBean id="DataView" scope="request"
             type="com.pub.database.DataView" />
<!-- 以下為DataView 共用設定 -->
<jsp:useBean id="DataViewForm" scope="request"
             type="com.pub.database.DataViewForm" />
<jsp:setProperty name="DataViewForm" property="submitMethod"
                 value="POST" />
<jsp:setProperty name="DataViewForm" property="pageRowCount" value="0" />
<jsp:setProperty name="DataViewForm" property="nowPageNum" />
<jsp:setProperty name="DataViewForm" property="dataViewAction" />
<jsp:setProperty name="DataViewForm" property="filterCol" />
<jsp:setProperty name="DataViewForm" property="filterValue" />
<jsp:setProperty name="DataViewForm" property="dvOrderByFields" />
<jsp:setProperty name="DataViewForm" property="dvOrderBySeq" />
<!-- DataView 設定結束 -->

<html>
    <head>
        <title><%=view.getPrgTitle()%></title>
        <LINK HREF="/SWD/workflow.css" REL="STYLESHEET" TYPE="TEXT/CSS">
        <script type="text/javascript" language="javascript1.2"
                src="/PUBPAGE/general/commscript.js"></script>
        <SCRIPT LANGUAGE="javascript1.2" SRC="/SWD/general/swd.js"></SCRIPT>
    <script language="javascript" type="text/javascript">
        function saveRowSn(rowsn){
            if(document.all.item('rowsn').value.indexOf(rowsn)>-1){
                return;//已記錄過就不再記錄了
            }
            if(document.all.item('rowsn').value==''){
                document.all.item('rowsn').value=rowsn;
            } else{
                document.all.item('rowsn').value=document.all.item('rowsn').value + ',' + rowsn;
            }
        }

        // 取得系統代號
        function fc_get_sys_no(){
            ret=window.showModalDialog("/SWD/pages/pub/find_wkf_menu.jsp","_blank",
            "status:no;dialogHeight:500px;dialogLeft:center;dialogTop:center;dialogWidth:500px");
            if(ret==null){return;}
            if (document.all.item('sys_group').value==''){
                document.all.item('sys_group').value=ret;
            }else {
                document.all.item('sys_group').value=document.all.item('sys_group').value + "," + ret;
            }
        }

        function fc_save_before_check(){
            // Frame 編號
            if (document.all.item('frame_no').value==""){
                alert("Frame 編號沒有值!!");
                return;
            }

            // frame 名稱
            if (document.all.item('frame_name').value==""){
                alert("Frame 名稱沒有值!!");
                return;
            }

            // 系統群組
            if (document.all.item('sys_group').value==""){
                alert("系統群組沒有值!!");
                return;
            }

            document.all.item('prgAction').value='save';
            document.forms[0].submit();
        }
    </script>
    </head>

    <body bgcolor="#ffffff" onload="<%=view.getOnloadScript()%>">
        <TABLE BORDER="0" HEIGHT="20" CELLPADDING="0" CELLSPACING="0">
            <TR>
                <TD BACKGROUND="/SWD/pub_images/title_bg.gif">
                    <DIV ALIGN="LEFT"><IMG SRC="/SWD/pub_images/title01.gif"
                                               WIDTH="18" HEIGHT="24" HSPACE="0" alt="" /><IMG
                        SRC="/SWD/pub_images/glass.gif" WIDTH="12" HEIGHT="8" alt="" /></DIV>
                </TD>
                <TD ALIGN="LEFT" HEIGHT="20" VALIGN="MIDDLE"
                    BACKGROUND="/SWD/pub_images/title_bg.gif" CLASS="TITLE"><%=view.getPrgTitle()%></TD>
                <TD BACKGROUND="/SWD/pub_images/title_bg.gif">
                    <DIV ALIGN="RIGHT"><IMG SRC="/SWD/pub_images/glass.gif"
                                                WIDTH="12" HEIGHT="8" alt="" /><IMG SRC="/SWD/pub_images/title02.gif"
                                                        WIDTH="18" HEIGHT="24" HSPACE="0" alt="" /></DIV>
                </TD>
            </TR>
        </TABLE>
        <br />
        <form action="<%=request.getRequestURI()%>" method="POST">
            <TABLE BORDER="0" CELLSPACING="1" CELLPADDING="0">
                <TR>
                    <TD style="" width="5%" CLASS="td_content"><INPUT TYPE="BUTTON"
                                                                          VALUE="新增" CLASS="button b_normal"
                                                                      ONCLICK="javascript:document.all.item('prgAction').value='add';document.forms[0].submit();" /></TD>
                    <TD style="" width="5%" CLASS="td_content"><INPUT TYPE="BUTTON"
                                                                          VALUE="<%=view.getBtnQueryTitle()%>" CLASS="button b_normal"
                                                                      ONCLICK="javascript:document.all.item('prgAction').value='query';document.forms[0].submit();" /></TD>
                    <TD style="" width="5%" CLASS="td_content"><INPUT TYPE="BUTTON"
                                                                          VALUE="<%=view.getBtnSaveTitle()%>" CLASS="button b_normal"
                                                                      ONCLICK="javascript:fc_save_before_check();" /></TD>
                    <TD style="" width="5%" CLASS="td_content"><INPUT TYPE="BUTTON"
                                                                          VALUE="<%=view.getBtnExitTitle()%>" CLASS="button b_normal"
                                                                      ONCLICK="javascript:document.all.item('prgAction').value='exit';document.forms[0].submit();" /></TD>
                    <TD width="80%" CLASS="td_content">&nbsp;</TD>
                </TR>
                <TR>
                    <TD colspan=5><font color="red"><%=(view.getTipMessage() != null ? "工作提示:" + view.getTipMessage() : "")%></font>
                    </TD>
                </TR>
            </TABLE>
            <TABLE BORDER="0" WIDTH="540px" CELLSPACING="1" CELLPADDING="0">
                <TR>
                    <TD nowrap WIDTH="20%" CLASS="td_head"><%=view.getframe_no_readonly() ? "" : "<img src=\"/SWD/pub_images/star.gif\">"%><%=view.getframe_noTitle()%></TD>
                    <TD WIDTH="30%" CLASS="td_content"><INPUT TYPE="TEXT"
                                                                  NAME="frame_no" SIZE="8" MAXLENGTH="8"
                                                                  VALUE="<%=(view.getframe_no() != null ? view.getframe_no() : "")%>"
                                                                  <%=view.getframe_no_readonly() ? "readonly" : "onDblClick=\"javascript:fc_get_frame_no(this);\""%>
                                                                  CLASS="<%=(view.getframe_no_readonly() ? "input_noborder" : "input_window hand")%>" />
                    </TD>
                    <TD nowrap WIDTH="20%" CLASS="td_head"><%=view.getframe_name_readonly() ? "" : "<img src=\"/SWD/pub_images/star.gif\">"%><%=view.getframe_nameTitle()%></TD>
                    <TD WIDTH="30%" CLASS="td_content"><INPUT TYPE="TEXT"
                                                                  NAME="frame_name" SIZE="23" MAXLENGTH="40"
                                                                  VALUE="<%=(view.getframe_name() != null ? view.getframe_name() : "")%>"
                                                                  <%=view.getframe_name_readonly() ? "readonly" : ""%>
                                                                  CLASS="<%=(view.getframe_name_readonly() ? "input_noborder" : "input")%>" />
                    </TD>
                </TR>
                <TR>
                <TD nowrap WIDTH="20%" CLASS="td_head"><%=view.getsys_group_readonly() ? "" : "<img src=\"/SWD/pub_images/star.gif\">"%><%=view.getsys_groupTitle()%></TD>
                <TD WIDTH="80%" CLASS="td_content" colspan="3"><INPUT
                        TYPE="TEXT" NAME="sys_group" SIZE="70" MAXLENGTH="500"
                        VALUE="<%=(view.getsys_group() != null ? view.getsys_group() : "")%>"
                        <%=view.getsys_group_readonly() ? "readonly" : ""%>
                        CLASS="<%=(view.getsys_group_readonly() ? "input_noborder" : "input_window hand")%>"
                    onDblClick="javascript:fc_get_sys_no();" /></TD>
            </TABLE>
            <INPUT TYPE="HIDDEN" NAME="asp_frame_path" SIZE="75,05" MAXLENGTH="100"
                   VALUE="<%=(view.getasp_frame_path() != null ? view.getasp_frame_path() : "")%>" />
            <INPUT TYPE="HIDDEN" NAME="jsp_frame_path" SIZE="75,05" MAXLENGTH="100"
                   VALUE="<%=(view.getjsp_frame_path() != null ? view.getjsp_frame_path() : "")%>" />
            <INPUT TYPE="HIDDEN" NAME="prgAction" VALUE="<%=view.getPrgAction()%>" />
            <INPUT TYPE="HIDDEN" NAME="prgStatus" VALUE="<%=view.getPrgStatus()%>" />
            <INPUT TYPE="HIDDEN" NAME="flowAction" VALUE="<%=view.getFlowAction()%>" />
            <INPUT TYPE="HIDDEN" NAME="flowStatus" VALUE="<%=view.getFlowStatus()%>" />

            <table BORDER="0" WIDTH="540px" CELLSPACING="1" CELLPADDING="0" style="">
                <!--<TD style="DISPLAY='<%=view.getBtnAddMenuShow()%>'" width="5%" CLASS="td_content"><INPUT TYPE="BUTTON" VALUE="<%=view.getBtnAddMenuTitle()%>" CLASS="button b_normal" ONCLICK="javascript:document.all.item('prgAction').value='addMenu';document.forms[0].submit();"/></TD>-->
                <tr>
                    <TD style="" width="5%" CLASS="td_content"><INPUT TYPE="BUTTON"
                                                                          VALUE="<%=view.getBtnSaveAllTitle()%>" CLASS="button b_normal"
                                                                      ONCLICK="javascript:document.all.item('prgAction').value='saveAll';document.forms[0].submit();" /></TD>
                    <TD width="90%" CLASS="td_content">&nbsp;</TD>
                </tr>
            </table>
            <TABLE BORDER="0" WIDTH="540px" CELLSPACING="1" CELLPADDING="0" style="">
                <tr>
                    <td>
                        <% if (view.getsys_group() != null && view.getframe_no().length() > 0) {
            DataView.OutputDataView(DataViewForm, pageContext);
        }
                        %>
                    </td>
                </tr>
            </TABLE>
        </form>
    </body>
</html>
